<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理| {:config('app_name')}</title>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__PUBLIC__/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="__PUBLIC__/css/style.css">
    <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
    {block name="style"}{/block}
</head>

<body class="layui-layout-body">
    {php}$isClose=isset($home_index)&&$home_index;{/php}
    <div class="layui-layout layui-layout-admin" layui-layout="{$isClose?'closed':''}">
        <div class="layui-header">
            <div class="layui-logo">
                <span>{:config('app_name')} 管理系统</span>
            </div>
            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                {php}if(!$isClose):{/php}
                <li class="layui-nav-item layadmin-flexible" lay-unselect>
                    <a href="{:url('index/flexible')}" class="ajax-flexible" title="侧边伸缩">
                        <i class="layui-icon layui-icon-shrink-right"></i>
                    </a>
                </li>
                {php}endif;{/php}
                <!--
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;" id="refresh" title="刷新数据">
                    <i class="layui-icon layui-icon-refresh"></i>
                    </a>
                </li>
                -->
            </ul>
            <ul class="layui-nav layui-layout-left" style="margin-left: 60px;">
                {php}$topNAV = app()->rbac->getMenu();{/php}
                {foreach name="topNAV.menu" id="top"}
                <li class="layui-nav-item"><a href="{$top.name|url}">{$top.title}</a></li>
                {/foreach}
            </ul>
            <ul class="layui-nav  layui-layout-right">
                <li class="layui-nav-item" lay-unselect="">
                    <a lay-href="app/message/" layadmin-event="message">
                      <i class="layui-icon layui-icon-notice"></i>
                      <span class="layui-badge-dot"></span>  
                    </a>
                </li>
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:" class="user"><img src="{:app()->user->face}" class="layui-nav-img">{:app()->user->nickname} <i class="layui-icon layui-icon-more-vertical"></i></a>
                    <dl class="layui-nav-child">
                        <dd><a href="{:url('info/user')}"><i class="fa  fa-user"></i> 个人信息</a></dd>
                        <hr>
                        {php}if(app()->rbac->isRole('super admin')):{/php}
                            <dd><a href="{:url('info/clearCache')}"><i class="fa fa-trash-o"></i> 清除缓存</a></dd>
                            <hr>
                        {php}endif;{/php}
                        <dd><a href="{:url('public/logout')}"><i class="fa fa-sign-out"></i> 退出</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        {php}$__NAV__ = app()->rbac->getMenu(null, null, 1);{/php}
        {include file="public/menu" /}
        <div class="main layui-body">
            <div class="main-header">
                <div class="layui-breadcrumb">
                    <a href="{:url('/')}"><i class="fa fa-dashboard"></i> 控制台</a>
                    {volist name="__NAV__.crumb" id="vo"}
                        <a href="{$vo.name|url}"><i class=<i class="fa {$vo.icon}"></i> {$vo.title}</a>
                    {/volist}
                </div>
            </div>
            <div class="main-content">
                {block name="body"}
                    <div class="layui-fluid" style="padding: 0 12px;">
                        <div class="layui-card">
                            <div class="layui-card-header">{$__NAV__.self.title}</div>
                            <div class="layui-card-body">
                                {block name="content"}{/block}
                            </div>
                        </div>
                    </div>
                {/block}
            </div>
            <div class="main-footer">
                <!-- 底部固定区域 -->
                Copyright © 2020-{:date('Y')} 龙玛拓ERP 后台管理系统. All rights reserved.
            </div>
        </div>
    </div>
    <script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
    <script type="text/javascript">
    layui.config({
        base: '__PUBLIC__/js/'
    }).use('longli');
    // 重置表格大小
    function resetTableSize(table, id)
    {
        if(!table || typeof table.resize !== "function") return;
        $(".ajax-flexible").click(function()
        {
            setTimeout(function()
            {
                table.resize(id);
            }, 300);
        });
    }
    </script>
    {block name="script"}{/block}
</body>

</html>